<%@ Page Language="C#" MasterPageFile="~/MainMaster.master" AutoEventWireup="true" CodeFile="specialized_dentist_cat.aspx.cs" Inherits="specialized_dentist_cat" Title="Untitled Page" %>

<%@ Register Assembly="Manager" Namespace="PagingControl" TagPrefix="cc1" %>
<%@ Register Src="~/includes/allspeciality_Dentist.ascx" TagName="allspecialityDentist" TagPrefix="uc" %>
<%@ MasterType VirtualPath="~/MainMaster.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainTable" runat="Server">
    <script>
        //Function use to send client data to server 

        var arggument = "";
        function LookUpStock() {
            //<%=ddlstate.ClientID%>
        //btnsearch,txtfname,txtlname,txtrating,ddlstate
        var fname, lname, rating, state;
        fname = document.getElementById('txtfname');
        //alert(fname.value);
        arggument = fname.value + "$";
        lname = document.getElementById('txtlname');
        //alert(lname.value); 
        arggument += lname.value + "$";
        rating = document.getElementById('<%=ddlRating.ClientID%>');
        //alert(rating.value)
            if (rating.value == "0") {
                arggument += "" + "$";
            }
            else {
                arggument += rating.value + "$";
            }
            state = document.getElementById('<%=ddlstate.ClientID%>');
        //alert(state.value);
            if (state.value == "0") {
                arggument += "" + "$";
            }
            else {
                arggument += state.value + "$";
            }

            if (fname.value == "" && lname.value == "" && rating.value == "0" && state.value == "0") {
                alert("Enter Search Criteria");
                return false;
            }
            else {
                // alert(fname + " " + lname + " " + rating.value + " " + state.value);
            }

        //alert(arggument);
            document.getElementById("imgSpinner").style.display = '';
            CallServer(arggument, "");
        }

        function ReceiveServerData(result) {
            document.getElementById('maingridview').style.display = 'none'
            //alert(result); litPaging,cntPaging  ,pagingliteral ,lblNoRecord ,<%=ddlstate.ClientID%>                                                         
            if (result.length == 0) {
                window.document.getElementById('Gridview').innerHTML = "";
                document.getElementById('<%=lblNoRecord.ClientID%>').innerHTML = "";
                window.document.getElementById('Gridview').innerHTML = "<table><tr><td align='center' style='padding-left:10px; color:Red'><b>No Records Found.</b></td></tr></table>";
            }
            else {

                window.document.getElementById('Gridview').innerHTML = "";
                window.document.getElementById('Gridview').innerHTML = result;

                document.getElementById("pagingcontrols").innerHTML = "";
                document.getElementById("pagingliteral").innerHTML = "";

                if (document.getElementById('<%=lblNoRecord.ClientID%>'))
                       document.getElementById('<%=lblNoRecord.ClientID%>').innerHTML = "";

               }

               document.getElementById("imgSpinner").style.display = 'none';
            //alert(result) ;       
           }

           function UpdateGrid(args) {
               //<%=ddlstate.ClientID%>
                //btnsearch,txtfname,txtlname,txtrating,ddlstate

                var fname, lname, rating, state;
                fname = document.getElementById('txtfname');
                //alert(fname.value);
                arggument = fname.value + "$";
                lname = document.getElementById('txtlname');
                //alert(lname.value); 
                arggument += lname.value + "$";

                rating = document.getElementById('<%=ddlRating.ClientID%>');
                //alert(rating.value)
            if (rating.value == "0") {
                arggument += "" + "$";
            }
            else {
                arggument += rating.value + "$";
            }

            state = document.getElementById('<%=ddlstate.ClientID%>');
                //alert(state.value);

            if (state.value == "0") {
                arggument += "" + "$";
            }
            else {
                arggument += state.value + "$";
            }
            arggument += args;
                //alert(document.getElementById("imgSpinner"));
                //alert();
            document.getElementById("imgSpinner").style.display = '';
                <%= ClientScript.GetCallbackEventReference(this,"arggument", "ReceiveServerData", null) %>;
            }

    </script>
    <% 
        int TotalRec = cntPaging.TotalRecord;
        //Response.Write(TotalRec);
        if (TotalRec <= 0) //No Record
        {
            gvDoctor.Visible = false;
            gvDoctorList.Visible = false;
            lblTitleMsg.Visible = false;
            cntPaging.Visible = false;

            lblNoRecord.Visible = true;
            lblNoRecord.Text = "There are no records to display in this specialty.";
            lblNoRecord.ForeColor = System.Drawing.Color.Red;

        }
        else //Record found
        {
            lblNoRecord.Visible = false;
            gvDoctor.Visible = true;
            cntPaging.Visible = true;

            //lblTitleMsg
            lblTitleMsg.Visible = true;
            lblTitleMsg.Text = "Dentists' Detail";
            lblTitleMsg.ForeColor = System.Drawing.Color.Navy;
            lblTitleMsg.Font.Bold = true;
            lblTitleMsg.Font.Size = 11;
        }
    %>
    <div class="heading_inner">
        <div class="heading_topic">
            <h2>Specialized Dentist</h2>
        </div>
    </div>

    <div class="cl"></div>
    <!---/ Left wrapper -->


    <div class="account_new">

        <div class="acc_nav" style="border-right: solid 1px #f2f2f2;">
            <!-- left content area starts from here -->
            <uc:allspecialityDentist ID="Allspeciality1" runat="server" />
            <!-- left content area ends here -->

        </div>

        <div style="height: auto; width: 720px; background-color: #f4f4f4; float: left; margin-left: 10px">

            <!--Content Area Starts-->
            <table align="left" border="0" cellpadding="0" cellspacing="0" style="text-align: justify; line-height: 20px; padding: 4%; width: 100%">


                <tr>
                    <td align="center" class="bodytxt" style="height: 20px">
                        <asp:Literal ID="litAlpha" runat="server" /><br />
                        <br />
                    </td>
                </tr>
                <!-- Start AJAX based search criteria -->
                <tr>
                    <td>
                        <asp:Panel ID="pnlSearchDoctor" runat="server" GroupingText="Search Dentist" Width="660px">
                            <table align="left">
                                <tr>
                                    <td style="border: 1px; width: 25%" align="left" class="bodytxt" valign="bottom">First name :&nbsp;<input id="txtfname" type="text" class="form-txt" />
                                        &nbsp;&nbsp;&nbsp;&nbsp;Last name :&nbsp;<input id="txtlname" type="text" class="bodytxt" />
                                        &nbsp;&nbsp;<img src="../../images/spinner20.gif" alt="" style="display: none;" id="imgSpinner" />
                                    </td>

                                </tr>

                                <tr>
                                    <td style="height: 20px; border: 0" align="left" class="bodytxt" valign="bottom">Rating :<span style="padding-left: 24px"><asp:DropDownList ID="ddlRating" runat="server" Width="145px" CssClass="mainselection">
                                    </asp:DropDownList></span>&nbsp;&nbsp;&nbsp;
                                            State :<span style="padding-left: 38px">;<asp:DropDownList ID="ddlstate" runat="server" Width="145px" class="mainselection"></asp:DropDownList></span>
                                        <span style="padding-left: 20px"><input id="btnsearch" type="button" value="Search" style="width: 70px; display: none;" onclick="LookUpStock()" />
                                        <img src="../../Images/search-btn.gif" alt="" onclick="LookUpStock()" /></span>
                                    </td>

                                </tr>
                            </table>
                        </asp:Panel>
                    </td>
                </tr>



                <!-- END AJAX based search criteria -->

                <tr>
                    <td style="height: 20px; padding-top: 10px" align="left" class="bodytxt">
                        <asp:Label runat="server" ID="lblTitleMsg" Visible="false"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="bodytxt" style="height: 20px">
                        <div id="pagingliteral">
                            <asp:Literal ID="litPaging" runat="server" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="width: 660px" align="center" class="bodytxt" valign="top">
                        <!--GridView Here-->
                        <div id="maingridview">
                            <asp:GridView ID="gvDoctor" runat="server" AllowPaging="false"
                                AutoGenerateColumns="False" BorderStyle="None" BorderWidth="0px"
                                CellPadding="5" CssClass="normalgrey_12" ShowFooter="True" Width="660px"
                                GridLines="None" EnableViewState="False"
                                OnRowDataBound="gvDoctor_RowDataBound">
                                <Columns>

                                    <asp:TemplateField HeaderText="Name">
                                        <HeaderStyle HorizontalAlign="Left" />
                                        <ItemStyle Width="125px" VerticalAlign="Top" />
                                        <ItemTemplate>
                                            <!-- Comented for implement new URL Formate at 16/07/08                                                                                                 
                                                <a class="link-result" href='<%=Session["strHttp"]%>dentist/DentistDetails.aspx?id=<%# Eval("Id") %><%#obj.FormatURL(Eval("specialityName"),Eval("subSpec"),Eval("state"),Eval("city"),Eval("zipcode"), true) %>'
                                                    title="Show Details">
                                                        <u><%# Eval("docname") %></u>
                                                </a>-->

                                            <a class="link-result" href='<%=Session["strHttp"]%>dentists/<%#obj.URLFormat(Eval("specialityName"),Eval("state"),Eval("city"), true)%>/<%# Eval("Id") %>-<%# Eval("docname") %>.aspx'
                                                title="Show Details">
                                                <u><%# Eval("docname") %></u>
                                            </a>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField HtmlEncode="false" DataField="address" HeaderText="Address" HeaderStyle-HorizontalAlign="left" ItemStyle-Width="125px" ItemStyle-VerticalAlign="top" />
                                    <asp:TemplateField HeaderText="Specialty / Subspecialty">
                                        <HeaderStyle HorizontalAlign="Left" />
                                        <ItemStyle VerticalAlign="Top" />
                                        <ItemTemplate>
                                            <%# Eval("specialityName")%><%# Eval("SubSpec").ToString() != "" ? ", " + Eval("SubSpec").ToString() : "" %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <%--<asp:BoundField HtmlEncode="false" DataField="specialityName" HeaderText="Specialty / Subspecialty" HeaderStyle-HorizontalAlign="left" ItemStyle-VerticalAlign="top" />--%>
                                    <asp:BoundField DataField="rating" HeaderText="Rating" HeaderStyle-HorizontalAlign="left">
                                        <ItemStyle Font-Bold="True" VerticalAlign="Top" ForeColor="Blue" Wrap="False" HorizontalAlign="left" Width="45px" />
                                        <HeaderStyle Wrap="False" />
                                    </asp:BoundField>

                                </Columns>
                                <RowStyle HorizontalAlign="Left" />
                                <HeaderStyle BackColor="Lavender" />
                            </asp:GridView>
                        </div>
                    </td>
                </tr>

                <!--For Custom Paging-->
                <tr>
                    <td align="right" style="width: 500px">
                        <div id="pagingcontrols">
                            <cc1:Paging ID="cntPaging" runat="server" ResultsLocation="Bottom"
                                StoredProcedureName="usp_getSpecializedDentistPaging"
                                OrderBy="fname" Control_Type="GridView" BindToControl="gvDoctor" PagerCount="10" PageSize="25" ShowFirst="False" ShowLast="False"></cc1:Paging>
                        </div>

                    </td>
                </tr>
                <tr>
                    <td align="center">
                        <asp:Label runat="server" ID="lblNoRecord" Visible="false" Font-Bold="true"></asp:Label>
                    </td>
                </tr>

                <!-- Start Bind Grid based on AJAX search criteria  at 250808-->
                <tr>
                    <td style="width: 660px" align="center" class="bodytxt" valign="top">
                        <div id="Gridview">
                            <!--GridView Here-->
                            <asp:GridView ID="gvDoctorList" runat="server" AllowPaging="true"
                                AutoGenerateColumns="False" BorderStyle="None" BorderWidth="0px"
                                CellPadding="5" CssClass="normalgrey_12" ShowFooter="True" Width="660px"
                                GridLines="None"
                                OnRowDataBound="gvDoctorList_RowDataBound">
                                <Columns>

                                    <asp:TemplateField HeaderText="Name">
                                        <HeaderStyle HorizontalAlign="Left" />
                                        <ItemStyle Width="125px" VerticalAlign="Top" />
                                        <ItemTemplate>
                                            <!-- Comented for implement new URL Formate at 16/07/08                                                                                                 
                                                <a class="link-result" href='<%=Session["strHttp"]%>dentist/DentistDetails.aspx?id=<%# Eval("Id") %><%#obj.FormatURL(Eval("specialityName"),Eval("subSpec"),Eval("state"),Eval("city"),Eval("zipcode"), true) %>'
                                                    title="Show Details">
                                                        <u><%# Eval("docname") %></u>
                                                </a>-->

                                            <a class="link-result" href='<%=Session["strHttp"]%>dentists/<%#obj.URLFormat(Eval("specialityName"),Eval("state"),Eval("city"), true)%>/<%# Eval("Id") %>-<%# Eval("docname") %>.aspx'
                                                title="Show Details">
                                                <u><%# Eval("docname") %></u>
                                            </a>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField HtmlEncode="false" DataField="address" HeaderText="Address" HeaderStyle-HorizontalAlign="left" ItemStyle-Width="125px" ItemStyle-VerticalAlign="top" />
                                    <asp:TemplateField HeaderText="Specialty / Subspecialty">
                                        <HeaderStyle HorizontalAlign="Left" />
                                        <ItemStyle VerticalAlign="Top" />
                                        <ItemTemplate>
                                            <%# Eval("specialityName")%><%# Eval("SubSpec").ToString() != "" ? ", " + Eval("SubSpec").ToString() : "" %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <%--<asp:BoundField HtmlEncode="false" DataField="specialityName" HeaderText="Specialty / Subspecialty" HeaderStyle-HorizontalAlign="left" ItemStyle-VerticalAlign="top" />--%>
                                    <asp:BoundField DataField="rating" HeaderText="Rating" HeaderStyle-HorizontalAlign="left">
                                        <ItemStyle Font-Bold="True" VerticalAlign="Top" ForeColor="Blue" Wrap="False" HorizontalAlign="left" Width="45px" />
                                        <HeaderStyle Wrap="False" />
                                    </asp:BoundField>

                                </Columns>
                                <RowStyle HorizontalAlign="Left" />
                                <HeaderStyle BackColor="Lavender" />
                            </asp:GridView>
                        </div>
                    </td>
                </tr>

                <!-- END AJAX based search criteria at 250808-->

            </table>
            <!--Content Area Ends-->

        </div>
        </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="InnerRight" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedBox" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="FeatureDocBox" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ScriptContent" runat="Server">
</asp:Content>

